package com.bawan.ddbb.dao;

import com.bawan.ddbb.domain.LoginLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * Desc:  LoginLogDao
 * Author: zhengcongchun
 * CreateTime: 2014-05-28 13:08
 * LastModifyTime: 2014-05-28 13:08
 * FinalModifier: zhengcongchun
 * Version: 1.0
 */
@Repository
public class LoginLogDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void insertLoginLog(LoginLog log) {
        String sql = "insert into t_login_log(user_id, visit_ip, login_datetime) values(?, ?, ?)";
        Object[] params = {log.getUserId(), log.getVisitIp(), log.getLoginDatetime()};
        jdbcTemplate.update(sql, params);
    }
}
